package com.zlsy.thread.synchronizedlearing;

/**
 * @author zhouliang
 * @date 2020/03/02
 **/
public class DispareRequest implements Runnable {

    static DispareRequest dispareRequest = new DispareRequest();

    static int i = 0;

    public static void main(String[] args) throws InterruptedException {
        Thread thread = new Thread(dispareRequest);
        Thread thread1 = new Thread(dispareRequest);
        thread.start();
        thread1.start();
        thread.join();
        thread.join();

        System.out.println(i);
    }

    @Override
    public void run() {
        for (int j = 0; j < 10000; j++) {
            i++;
        }
    }
}
